Aiming at the problem that the data traffic rises with the increase of data visitors in large-scale Wireless Sensor Networks (WSN), a data traffic optimization WSN system framework was designed and implemented to build large-scale WSN and reduce the network data traffic. The IPv6 and IPv6 over Low Power Wireless Personal Area Network (6LoWPAN) technology were adopted to build large-scale WSN. To integrate the WSN and traditional Internet, the Message Queuing Telemetry Transport (MQTT) and Message Queuing Telemetry Transport for Sensor Network (MQTT-SN) protocols were deployed in application layer to build system publish/subscribe model. The experimental results show that, when system has 5 sensor nodes, compared with the Constrained Application Protocol (CoAP) based WSN system, the data traffic of the proposed system is 18% of the former. It proves that the proposed system framework can effectively control the impact caused by increasing visitors to WSN data traffic.